<template>
    <div class="main-content">
        <!-- 表格工具栏 -->
        <div class="table-toolbar">
            <el-button type="primary" size="mini" v-authCode.show="showAuthBtn('search')" @click="handleBtn('search')">查询</el-button>
            <el-button type="primary" size="mini" v-authCode.show="showAuthBtn('import')" @click="handleBtn('import')" v-if="forProduction"
                >导入</el-button
            >
            <el-button type="primary" size="mini" v-authCode.show="showAuthBtn('export')" @click="handleBtn('export')">导出</el-button>
            <el-checkbox v-model="searchParams.showEffective_" class="item" @change="handleBtn('showEffective_')">只展示当前有效映射</el-checkbox>
            <el-checkbox v-model="searchParams.moveSame_" @change="handleBtn('moveSame_')"
                >条目去重
                <el-tooltip>
                    <div slot="content" style="white-space: pre">同一条目同时对应不同来源类型下的条款时,优先级:法律法规＞产品合同＞公司制度</div>
                    <i class="el-icon-question"></i> </el-tooltip
            ></el-checkbox>
            <el-checkbox v-model="searchParams.showPending_" label="showPending_" @change="handleBtn('showPending_')">只展示待办</el-checkbox>

            <el-button type="primary" size="mini" v-authCode.show="showAuthBtn('layout')" @click="layoutDialog = true" class="right-box"
                >布局设置</el-button
            >
        </div>
        <RiskTableP
            ref="risk-table"
            :tableData="tableData"
            :tableConfig="tableConfig"
            :column="showColumns"
            :paging="paging"
            v-loading="tableLoading"
            minWidth="120px"
            class="table"
            :key="tableKey"
            :searchParams="searchParams"
            @page-change="pageChange"
        >
            <template #O32EntryCode_="{ row }">
                <vxe-input v-model="row.O32EntryCode_" :disabled="!forProduction"></vxe-input>
                <!-- 失去焦点，根据code来回显名称等其他数据，请求接口更新数据， -->
                <!-- @blur="blurOrderPrice(row)" -->
            </template>
            <template #O32EntryName_="{ row }"> <vxe-input v-model="row.O32EntryName_" :disabled="!forProduction"></vxe-input></template>
            <template #YhEntryCode_="{ row }"> <vxe-input v-model="row.YhEntryCode_" :disabled="!forProduction"></vxe-input> </template>
            <template #YhEntryName_="{ row }"> <vxe-input v-model="row.YhEntryName_" :disabled="!forProduction"></vxe-input></template>
            <template #cardRemark_="{ row }"> <vxe-input v-model="row.cardRemark_" :disabled="!forProduction"></vxe-input></template>
            <template #operation="{ row }">
                <RiskIconButton
                    type="primary"
                    icon="el-icon-view"
                    topTitle="查看合规卡"
                    size="mini"
                    v-authCode="showAuthBtn('row-look')"
                    @on-click="handleRowData('look', row)"
                ></RiskIconButton>
                <RiskIconButton
                    type="primary"
                    icon="el-icon-document-copy"
                    topTitle="复制合规卡"
                    size="mini"
                    v-authCode="showAuthBtn('row-copy')"
                    @on-click="handleRowData('copy', row)"
                    v-if="forProduction"
                ></RiskIconButton>
                <RiskIconButton
                    type="danger"
                    icon="el-icon-delete"
                    topTitle="删除合规卡"
                    size="mini"
                    :disabled="row.isOrigin"
                    v-authCode="showAuthBtn('row-delete')"
                    @on-click="handleRowData('delete', row)"
                    v-if="forProduction"
                ></RiskIconButton>
                <!-- 系统自动生成的合规卡不允许删除 -->
                <!-- xz 0待办  1已办 -->
                <RiskIconButton
                    :type="row.cardStatus_ == '0' ? 'primary' : 'success'"
                    :icon="row.cardStatus_ == '0' ? 'yh-cash-frozen' : 'yh-jiaoyizhihangfuhe'"
                    topTitle="待办设置"
                    size="mini"
                    v-authCode="showAuthBtn('row-deal')"
                    @on-click="handleRowData('deal', row)"
                    class="deal-btn"
                    v-if="forProduction"
                ></RiskIconButton>
            </template>
        </RiskTableP>

        <!-- 查询 -->
        <yh-dialog title="查询合规卡" :visible.sync="searchVisible" drag :close-on-click-modal="false" :close-on-press-escape="false">
            <CardSearch :reqParams="searchParams" ref="risk-search" />
            <div slot="footer">
                <el-button @click="searchVisible = false">取 消</el-button>
                <el-button @click="searchDialogBtn('reset')">重 置</el-button>
                <el-button type="primary" @click="searchDialogBtn('confirm')">确 认</el-button>
            </div>
        </yh-dialog>

        <!-- 查看、复制 -->
        <el-dialog
            :title="currentRow.showDialogTitle"
            :visible.sync="basicInfoVisible"
            width="80%"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
        >
            <CardInfo :info="currentRow" ref="basic-info" v-if="basicInfoVisible" />
            <div slot="footer" class="dialog-footer">
                <el-button @click="BasicDialogBtn('cancel')">取 消</el-button>
                <el-button type="primary" @click="BasicDialogBtn('confirm')" v-if="currentRow.operationType == 'copy'">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 布局设置 -->
        <RiskTableLayout
            ref="risk-table-layout"
            :tableName="'CARD_PRODUCTION_MAIN_TEST'"
            :visible.sync="layoutDialog"
            :column="columns"
            :fixedColumns="fixedColumns"
        />

        <!-- 导入 -->
        <CardImportFile :treeNodeData="treeNodeData" :visible="importVisible" @emitImportFile="emitImportFile"></CardImportFile>

        <!-- 导出 -->
        <el-dialog title="导出" :visible.sync="exportVisible" width="30%" :close-on-click-modal="false" :close-on-press-escape="false">
            文件名：<el-input v-model="exportName" size="mini"></el-input>
            <div slot="footer" class="dialog-footer">
                <el-button @click="exportVisible = false">取 消</el-button>
                <el-button type="primary" @click="exportDialogBtn()">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 删除 -->
        <el-dialog
            title="确定删除以下合规卡吗？"
            :visible.sync="deleteVisible"
            width="30%"
            :close-on-click-modal="false"
            :close-on-press-escape="false"
        >
            <div>合规卡编号：{{ currentRow.cardCode_ }}</div>
            <div slot="footer" class="dialog-footer">
                <el-button @click="deleteDialogBtn('cancel')">取 消</el-button>
                <el-button type="primary" @click="deleteDialogBtn('confirm')">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 待办设置 -->
        <yh-dialog title="待办设置" :visible.sync="dealVisible" drag :close-on-click-modal="false" :close-on-press-escape="false">
            <div class="deal-dialog">
                <!-- 0待办 1已办 -->
                <h2>{{ currentRow.cardStatus_ == '1' ? '确定要设为待办吗？' : '当前已为待办状态' }}</h2>
                <div class="text-info">
                    <span>合规卡编号：{{ currentRow.cardCode_ }}</span>
                    &nbsp;<span v-if="currentRow.cardStatus_ == '0'">待办编号：{{ currentRow.pendingCode_ }}</span>
                </div>
                <div class="tip"><span>*</span>待办提示内容：</div>
                <el-input v-model="currentRow.pendingReamrkContent_" type="textarea" :rows="8" placeholder="请输入"> </el-input>
            </div>
            <div slot="footer">
                <el-button @click="dealVisible = false">取消</el-button>
                <el-button type="primary" @click="dealDialogBtn('confirm')" v-if="currentRow.cardStatus_ == '1'">确认</el-button>
                <el-button type="primary" @click="dealDialogBtn('update')" v-if="currentRow.cardStatus_ == '0'">修改待办提示内容</el-button>
                <el-button type="primary" @click="dealDialogBtn('cancel')" v-if="currentRow.cardStatus_ == '0'">取消待办</el-button>
            </div>
        </yh-dialog>
    </div>
</template>
<script lang="ts">
import RiskIconButton from '@/common/components/risk-icon-button.vue';
import RiskTableP from '@/common/components/risk-table-plus.vue';
import { ColumnVO, PageVO, TableConfigVO, VueObject } from '@/common/vo';
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
import { cardSearchDTO, cardSearchReqVO } from '../../vo';
import CardInfo from './card-info.vue';
import CardImportFile from './card-import-file.vue';
import CardSearch from './card-search.vue';
import API from '../../api/index';
import RiskTableLayout from '@/common/components/risk-table-layout-plus.vue';
import Dict from '../../dict/index';
import DictionConstUtil from '@/utils/diction-const-util';
@Component({ name: 'CardProductionMain', components: { RiskTableP, RiskIconButton, CardImportFile, CardSearch, CardInfo, RiskTableLayout } })
export default class CardProductionMain extends Vue {
    Dict = new Dict();
    tableConfig: TableConfigVO = {
        rowKey: 'cardCode_', // 主键key
        allRowKeys: [], // 所有页数据的key集合
    };
    // cardSearchDTO
    tableData: any[] = [
        {
            cardCode_: 'HGK001',
            termCode_: 'tk1',
            O32EntryCode_: 'O12',
            cardStatus_: '0',
            isOrigin: false,
            pendingCode_: 'DB001',
            sourceType_: '1',
            sourceStatus_: '1',
            YhEntryStatus_: '0',
            O32EntryStatus_: '1',
        },
        {
            cardCode_: '22',
            termCode_: 'tk2',
            O32EntryCode_: 'O22',
            O32EntryName_: 'OName22',
            YhEntryCode_: 'Yh22',
            YHEntryName: 'YhName22',
            cardStatus_: '1',
            isOrigin: true,
            sourceType_: '3',
            sourceStatus_: '0',

            YhEntryStatus_: '1',
            O32EntryStatus_: '0',
        },
    ];
    columns: ColumnVO[] = [
        {
            type: 'checkbox',
            selectedAll: false,
            fixed: 'left',
            align: 'center',
            width: 60,
        },
        {
            field: 'cardCode_',
            title: '合规卡编号',
            minWidth: '140px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'termCode_',
            title: '条款编号',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'termId_',
            title: '条款号',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'termName_',
            title: '条款名称',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'suitableFund_',
            title: '条款适用产品',
            minWidth: '160px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'suitableExemptFund_',
            title: '条款豁免产品',
            minWidth: '150px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'sourceCode_',
            title: '来源编号',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'sourceName_',
            title: '来源名称',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'sourceVisible_',
            title: '来源版本号',
            minWidth: '150px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'sourceSuitableFund_',
            title: '来源适用产品',
            minWidth: '160px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'sourceStatus_',
            title: '来源状态',
            sortable: true,
            filterType: 'funnel',
            filters: DictionConstUtil.PojoToList3(this.Dict.sourceStatusPojo),
            render: value => this.Dict.sourceStatusPojo[value],
            style: value => {
                return {
                    color: {
                        '0': 'red',
                        '1': 'green',
                    }[value],
                };
            },
        },
        {
            field: 'O32EntryCode_',
            title: 'O32条目编号',
            minWidth: '160px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'O32EntryName_',
            title: 'O32风险说明',
            minWidth: '180px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'O32EntryStatus_',
            title: 'O32条目状态',
            minWidth: '150px',
            sortable: true,
            filterType: 'funnel',
            filters: DictionConstUtil.PojoToList3(this.Dict.IsOpen),
            render: value => this.Dict.IsOpen[value],
            style: value => {
                return {
                    color: {
                        '0': 'red',
                        '1': 'green',
                    }[value],
                };
            },
        },
        {
            field: 'O32EntryEffecDate_',
            title: 'O32条目生效日期',
            minWidth: '180px',
            sortable: true,
        },
        {
            field: 'O32EntryLoseEffecDate_',
            title: 'O32条目失效日期',
            minWidth: '180px',
            sortable: true,
        },
        {
            field: 'YhEntryCode_',
            title: 'YH条目编号',
            minWidth: '160px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'YhEntryName_',
            title: 'YH风险说明',
            minWidth: '180px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'YhEntryStatus_',
            title: 'YH条目状态',
            minWidth: '150px',
            sortable: true,
            filterType: 'funnel',
            filters: DictionConstUtil.PojoToList3(this.Dict.IsOpen),
            render: value => this.Dict.IsOpen[value],
            style: value => {
                return {
                    color: {
                        '0': 'red',
                        '1': 'green',
                    }[value],
                };
            },
        },
        {
            field: 'YhEntryType_',
            title: 'YH条目类型',
            minWidth: '150px',
            sortable: true,
            filterType: 'funnel',
            filters: [],
        },
        {
            field: 'YhEntryEffecDate_',
            title: 'YH条目生效日期',
            minWidth: '170px',
            sortable: true,
        },
        {
            field: 'YhEntryLoseEffecDate_',
            title: 'YH条目失效日期',
            minWidth: '170px',
            sortable: true,
        },
        {
            field: 'cardRemark_',
            title: '合规卡备注',
            minWidth: '180px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'cardStatus_',
            title: '合规卡状态',
            minWidth: '150px',
            sortable: true,
            filterType: 'funnel',
            filters: DictionConstUtil.PojoToList3(this.Dict.cardStatusPojo),
            render: value => this.Dict.cardStatusPojo[value],
            style: value => {
                return {
                    color: {
                        '0': 'red',
                        '1': 'green',
                    }[value],
                };
            },
        },
        {
            field: 'creator_',
            title: '创建人',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'creatDate_',
            title: '创建时间',
            sortable: true,
        },
        {
            field: 'modifier_',
            title: '更新人',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'moduifyDate_',
            title: '更新时间',
            sortable: true,
        },
        {
            field: 'operation',
            title: '操作',
            fixed: 'right',
            width: this.forProduction ? 220 : 120,
            align: 'center',
            notShowTooltip: true,
        },
    ];
    fixedColumns: ColumnVO[] = [
        {
            field: 'cardCode_',
            title: '合规卡编号',
            minWidth: '140px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'termCode_',
            title: '条款编号',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'sourceCode_',
            title: '来源编号',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'O32EntryCode_',
            title: 'O32条目编号',
            minWidth: '160px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
        {
            field: 'YhEntryCode_',
            title: 'YH条目编号',
            minWidth: '160px',
            sortable: true,
            filterType: 'search',
            filters: [{ data: '' }],
        },
    ];
    tableKey: number = -1;
    showColumns: ColumnVO[] = [];
    searchParams: cardSearchReqVO = {
        cardCode_: '',
        termCode_: '',
        termId_: '',
        termName_: '',
        suitableFund_: '',
        suitableExemptFund_: '',
        sourceCode_: '',
        sourceName_: '',
        sourceVisible_: '',
        sourceSuitableFund_: '',
        sourceType_: '',
        O32EntryCode_: '',
        O32EntryName_: '',
        O32EntryStatus_: '',
        O32EntryEffecDate_: '',
        O32EntryLoseEffecDate_: '',
        YhEntryCode_: '',
        YhEntryName_: '',
        YhEntryStatus_: '',
        YhEntryType_: '',
        YhEntryEffecDate_: '',
        YhEntryLoseEffecDate_: '',
        cardRemark_: '',
        cardStatus_: '',
        creator_: '',
        creatDate_: '',
        modifier_: '',
        moduifyDate_: '',
        showEffective_: true,
        moveSame_: true,
        showPending_: true,
        sourceStatus_: '',
    };
    // 重置请求参数模板(切换节点清除查询参数时用)
    clearParamsModel: cardSearchReqVO = {
        cardCode_: '',
        termCode_: '',
        termId_: '',
        termName_: '',
        suitableFund_: '',
        suitableExemptFund_: '',
        sourceCode_: '',
        sourceName_: '',
        sourceVisible_: '',
        sourceSuitableFund_: '',
        sourceType_: '',
        O32EntryCode_: '',
        O32EntryName_: '',
        O32EntryStatus_: '',
        O32EntryEffecDate_: '',
        O32EntryLoseEffecDate_: '',
        YhEntryCode_: '',
        YhEntryName_: '',
        YhEntryStatus_: '',
        YhEntryType_: '',
        YhEntryEffecDate_: '',
        YhEntryLoseEffecDate_: '',
        cardRemark_: '',
        cardStatus_: '',
        creator_: '',
        creatDate_: '',
        modifier_: '',
        moduifyDate_: '',
        showEffective_: true,
        moveSame_: true,
        showPending_: true,
        sourceStatus_: '',
    };

    paging: PageVO = { currentPage: 1, pageSize: 25, total: 0 };

    tableLoading: boolean = false;

    currentRow: any = {};
    searchVisible: boolean = false; // 查询框
    exportVisible: boolean = false;
    basicInfoVisible: boolean = false; // look|copy卡基本信息
    deleteVisible: boolean = false;
    dealVisible: boolean = false;
    importVisible: boolean = false;
    layoutDialog: boolean = false;
    checkRowKeys: string[] = [];
    checkedRows: any[] = [];
    exportName: string = ''; // 导出文件名

    @Prop() treeNodeData: any;
    /**
     * 左侧树节点的改变
     * 处理内容：查询条件重置（筛选条件）
     */
    @Watch('treeNodeData', { deep: true })
    changeNode() {
        // debugger;
        this.$nextTick(() => {
            const $Table = this.$refs['risk-table'] as any;
            const $xTable = $Table?.$refs['xTable'];
            ($xTable as any).clearFilter();
            this.searchParams = JSON.parse(JSON.stringify(this.clearParamsModel));
            // treeNodeData中的字段对应查询参数中的哪些 TODO
            this.getTableData();
        });
    }

    /**
     * 是否为合规卡制作
     */
    get forProduction() {
        console.log(this.$attrs.pageType, '------------------');

        return this.$attrs.pageType == 'production';
    }
    mounted() {
        // 监听布局设置
        this.$watch(
            () => {
                return (this.$refs['risk-table-layout'] as VueObject).showColumns;
            },
            val => {
                this.showColumns = val && val.length ? val : this.columns;
                this.tableKey++;
            }
        );
        this.getTableData();
    }
    /**
     * 获取卡片列表
     */
    getTableData() {
        this.tableLoading = true;

        API.cardList({ ...this.searchParams, paging: this.paging })
            .then((res: any) => {
                this.tableData = res.list;
                this.paging.total = res.total;
            })
            .finally(() => {
                this.tableLoading = false;
            });
    }
    /**
     * 分页、排序、筛选等
     */
    pageChange() {
        this.getTableData();
    }
    /**
     * 查询|导入|导出|复选框改变 事件
     *   只展示当前有效映射|条目去重|只展示待办
     * @operation 操作类型 search|import|export|showEffective_|moveSame_|showPending_
     * @row 行数据
     */
    async handleBtn(operation: string): Promise<void> {
        console.log('查询|导入|导出|复选框改变:', operation);
        if (operation === 'search') {
            this.searchVisible = true;
        } else if (operation === 'import') {
            this.importVisible = true;
        } else if (operation === 'export') {
            // 导出时需要填写导出名称
            this.exportVisible = true;
        } else if (['showEffective_', 'moveSame_', 'showPending_'].includes(operation)) {
            this.paging.currentPage = 1;
            this.getTableData();
        }
    }

    /**
     * 操作行 type:look|copy|copy-confirm|delete|deal
     */
    handleRowData(type: string, row: any) {
        console.log('操作行:', type, row);
        this.currentRow = JSON.parse(JSON.stringify(row));
        this.currentRow.operationType = type;
        if (type == 'look') {
            this.currentRow.showDialogTitle = `查看合规卡(${this.currentRow.cardCode_})`;
            this.basicInfoVisible = true;
        } else if (type == 'copy') {
            this.currentRow.showDialogTitle = `复制合规卡(${this.currentRow.cardCode_})`;
            this.basicInfoVisible = true;
        } else if (type == 'delete') {
            this.checkRowKeys = [row.cardCode_];
            this.checkedRows = [{ cardCode_: row.cardCode_ }];
            this.deleteVisible = true;
        } else if (type == 'deal') {
            this.dealVisible = true;
        }
    }

    /**
     * 查询弹框按钮处理 type:reset|confirm
     */
    searchDialogBtn(type: string) {
        let $ref: any = this.$refs['risk-search'] as any;
        if (type == 'reset') {
            $ref.reset();
        } else if (type == 'confirm') {
            let params = $ref.cardSearchParams;
            this.searchParams = JSON.parse(JSON.stringify(params));
            this.getTableData();
            // 查询弹框中的参数要同步到表头
        }
    }

    /**
     * 删除弹框按钮处理 type:cancel|confirm
     */
    deleteDialogBtn(type: string) {
        if (type == 'cancel') {
            this.deleteVisible = false;
        } else if (type == 'confirm') {
            API.deleteCard({ cardCode: this.currentRow.cardCode_ })
                .then((res: any) => {
                    this.yh_message_success('删除成功！');
                    this.getTableData();
                })
                .finally(() => {
                    this.deleteVisible = false;
                });
        }
    }
    /**
     * 确认|修改待办提示内容|取消待办
     * 待办弹框按钮处理 type:cancel|confirm|update
     */
    dealDialogBtn(type: string) {
        let params = { cardCode: this.currentRow.cardCode_, type };
        let title = '';
        if (type == 'cancel') {
            // 取消待办
            this.dealVisible = false;
            title = '已成功取消待办!';
        } else {
            if (!this.currentRow.pendingReamrkContent_) {
                this.yh_message_info('待办提示内容不可为空！');
                return;
            }
            if (type == 'confirm') {
                title = '已成功设置为待办！';
            } else if (type == 'update') {
                title = '已成功修改待办提示内容!';
            }
        }
        API.dealConfig(params)
            .then((res: any) => {
                this.yh_message_success(title);
                this.getTableData();
            })
            .finally(() => {
                this.dealVisible = false;
            });
    }

    /**
     * 查看、复制
     */
    BasicDialogBtn(type: string) {
        if (type == 'cancel') {
            this.basicInfoVisible = false;
        } else if (type == 'confirm') {
            // 查看无需处理，复制请求接口
            let info = (this.$refs['basic-info'] as any).basicForm;
            API.copyCard(info)
                .then((res: any) => {
                    this.yh_message_success('复制成功!');
                })
                .catch(() => {})
                .finally(() => {
                    this.basicInfoVisible = false;
                });
        }
    }

    /**
     * 导出确认
     */
    async exportDialogBtn() {
        let checkRowKeys = (this.$refs['risk-table'] as any).checkRowKeys || [];
        await API.downLoadFileCard({ ...this.searchParams, checkRowKeys, exportName: this.exportName });
        this.exportVisible = false;
    }
    /**
     * 导入确认
     */
    async emitImportFile() {
        this.importVisible = false;
        this.getTableData();
    }

    /**
     * 按钮权限设置
     */
    showAuthBtn(type: string) {
        let obj = {};
        if (this.forProduction) {
            obj = {
                search: '',
                import: '',
                export: '',
                layout: '',
                'row-look': '',
                'row-copy': '',
                'row-delete': '',
                'row-deal': '',
            };
        } else {
            obj = {
                search: '',
                import: '',
                export: '',
                layout: '',
                'row-look': '',
            };
        }
        return 'B_0016';
        // return obj[type];
    }
}
</script>
<style lang="scss" scoped>
.main-content {
    height: 100%;
    .table-toolbar {
        padding: 12px;
        .item {
            margin-left: 10px;
        }
        .right-box {
            float: right;
        }
    }
    .table {
        height: calc(100% - 60px) !important;
    }
}
.deal-btn {
    // .el-button {
    height: 22px;
    width: 22px;
    border-radius: 50%;
    padding: 0px !important;
    // }
}
.deal-dialog {
    h2 {
        font-size: 16px;
    }
    .text-info {
        margin: 10px 0;
    }
    .tip span {
        color: red;
    }
}
.vxe-input.size--mini {
    height: 26px;
    line-height: 36px;
}
/deep/ .el-textarea .el-textarea__inner {
    resize: none;
}
</style>
